﻿using mozhi.smarterp.Business.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace mozhi.smarterp.Business.Sales.Orders
{
    public class SaleOrderCreateDto
    {
        [Required]
        public SaleOrderType Type { get; set; }

        [Required]
        public DateTime Date { get; set; }

        [Required]
        public Guid CustomerId { get; set; }

        public string Address { get; set; }

        public Guid? DepartmentId { get; set; }

        public Guid? SalePersonId { get; set; }

        [Required]
        public Guid CurrencyId { get; set; }

        [Required]
        public decimal ExchangeRate { get; set; }

        public Guid? PaymentTermId { get; set; }

        public bool IncludeTax { get; set; }

        public string Comment { get; set; }

        public List<SaleOrderItemCreateDto> Items { get; set; }
    }

    public class SaleOrderItemCreateDto
    {
        [Required]
        public Guid ProductId { get; set; }

        [Required]
        public Guid SaleUnitId { get; set; }

        [Required]
        public decimal SaleQuantity { get; set; }

        [Required]
        public decimal Price { get; set; }

        public Guid? TaxRateId { get; set; }

        public bool IsGift { get; set; }

        public string Remark { get; set; }
    }
}
